<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>普通用户后台</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}">
    <link rel="stylesheet" th:href="@{/css/amazeui.css}">
    <script th:src="@{/js/jquery.js}"></script>
    <script th:src="@{/js/bootstrap.js}"></script>
</head>
<body style="padding-top: 70px; background-color:#f1f1f1;">
<div th:replace="commons/commonUserAdmin/topbar::topbar"></div>
<div class="container">
    <div class="row">

        <div th:replace="commons/commonUserAdmin/leftbar::leftbar"></div>


        <div class="col-md-9">

            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-comment"></span>&nbsp;我的评论</a></li>
            </ul>
            <div class="tab-content"><br>
                <div role="tabpanel" class="tab-pane active" id="home">
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>评论内容</th>
                                <th>评论时间</th>
                                <th>被回复的人</th>
                                <th>原文链接</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="comment : ${comments}">
                                <td th:text="${comment.getCommentContent()}"></td>
                                <td th:text="${comment.getCommentDate()}"></td>
                                <td th:if="${comment.getRespondentName()}!=null" th:text="${comment.getRespondentName()}"></td>
                                <td th:if="${comment.getRespondentName()}==null" >无</td>
                                <td>
                                    <a target="_blank" th:href="'/articlePage/'+@{${comment.getArticleId()}}">点击查看原文</a>
                                </td>
                                <td>
                                    <a class="btn-sm btn-danger" th:href="@{/userAdmin/deleteComment/}+@{${comment.getId()}}">删除</a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        共有<span th:text="${commentSize}" style="color:deeppink;font-size: 18px;"></span>条评论
                        <h2 style="color: red">温馨提示: 删除评论会自动删除该评论下的所有子评论</h2>
                    </div>
                </div>
            </div><br><br>
        </div>


    </div>
</div>
<div class="container-fluid">
    <div class="row">
        <div style="position: fixed; bottom: 5px; right: 10px;">
            <div class="pull-right"><a href="" target="_blank">软件18-2班第三组</a>&nbsp;&nbsp;</div>&nbsp;
        </div>
    </div>
</div>
</body>
<script type="text/javascript" th:inline="javascript">
    //后台右上角的头像图标
    $("#userIcon").attr('src','http://localhost:8080'+[[${user.avatarImgUrl}]]);
</script>
</html>